@extends('layouts.app')

@section('content')
    <el-row style="padding: 5px;">
        <el-row class="community-title">
            <el-row>小区楼栋分布图：</el-row>
        </el-row>
        {{--小区图纸--}}
        <el-row class="community-thumb" :style="communityStyle">
            <el-col v-for="(item, index) in buildingList"
                    :key="index"
                    class="community-building">
                <div v-if="item.id" @click="goBuildingDetail(item)">
                    <el-link type="danger">@{{ item.build_num  }}</el-link>
                </div>
                <div v-else="item.id" @click="showBuildingDetail(item)">
                    <el-link type="primary">@{{ item.build_num  }}</el-link>
                </div>
            </el-col>
        </el-row>

        <el-row class="community-title">
            <el-row>小区信息：</el-row>
        </el-row>
        {{--小区描述--}}
        <el-row>
            <el-col>
                名称：@{{ community.name }}
            </el-col>
            <el-col>
                地址：@{{ community.address }}
            </el-col>
            <el-col>
                描述：@{{ community.description }}
            </el-col>
            <el-col>
                备注：@{{ community.remarks }}
            </el-col>
        </el-row>
    </el-row>

    <el-dialog
            title="楼栋详情"
            :visible.sync="dialog.isShow"
            width="90%">
        <el-form label-width="60px">
            <el-form-item label="编号">
                <el-input v-model="buildingDetail.build_num"></el-input>
            </el-form-item>
            <el-form-item label="名称">
                <el-input v-model="buildingDetail.name"></el-input>
            </el-form-item>
            <el-form-item label="描述">
                <el-input v-model="buildingDetail.description"></el-input>
            </el-form-item>
            <el-form-item label="备注">
                <el-input v-model="buildingDetail.remarks"></el-input>
            </el-form-item>
        </el-form>
        <el-row style="text-align:center;">
            <el-button type="primary" @click="buildingSave" :disabled="dialog.disabled">保存</el-button>
            <el-button type="primary" @click="buildingSave" :disabled="buildingDetail.id ? false : true">进入楼栋</el-button>
        </el-row>
    </el-dialog>
@endsection

@section('js')
    <script src="/js/community/detail.js"></script>
@endsection